package com.chenqi.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

/**
 * @description: 文章实体
 * @program: ardaicommunity
 * @author: ChenQi
 * @create: 2021-03-2021/3/11-14-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bms_post")
public class Post {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 标题
     */
    private String title;
    /**
     * 文章内容
     */
    private String content;
    /**
     * 创建用户的id
     */
    @TableField("user_id")
    private Integer userId;
    /**
     * 评论数
     */
    private Integer comments;
    /**
     * 收藏数
     */
    private Integer collects;
    /**
     * 浏览次数
     */
    private Integer view;
    /**
     * 是否置顶
     */
    private Integer top;
    /**
     * 是否加精
     */
    private Integer essence;
    /**
     * 专栏id
     */
    @TableField("section_id")
    private Integer sectionId;
    /**
     * 创建时间
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date createTime;
    /**
     * 修改时间
     */
    @TableField("modify_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date modifyTime;

    /**
     * 文章关联的用户
     */
    @TableField(exist = false)
    private User user;

    @TableField(exist = false)
    private List<Tag> tagList;

}
